﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Linq;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.Data;

namespace MsgQueueTest
{
    public class DataManager
    {
        private static Database database;

        static DataManager()
        {
            database = DatabaseFactory.CreateDatabase();
        }

        public static DataTable FindPickTicketNumber(string command)
        {

            DbCommand dbCommand = database.GetSqlStringCommand(command);

            using (DataSet dataSet = database.ExecuteDataSet(dbCommand))
            {
                if (dataSet != null && dataSet.Tables.Count > 0)
                {
                    return dataSet.Tables[0];
                }
                return null;
            }
        }
    }
}
